package Review2;

import java.util.Stack;

public class Test21 {
    Stack<Integer> stack1 = new Stack<Integer>();
    Stack<Integer> stack2 = new Stack<Integer>();
    public void push(int value){
    	stack1.push(value);
    	if(stack2.isEmpty()||value<stack1.peek()){
    		stack2.push(value);
    	}
    	else{
    		stack2.push(stack2.peek());
    	}
    }
    public void pop(){
    	if(!stack1.isEmpty()&&!stack2.isEmpty()){
    		stack1.pop();
    		stack2.pop();
    	}
    }
    public int min(){
    	return stack2.peek();
    }
}
